home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
Bitmap.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-08-24
|
2KB
|
80 lines
#ifndef Bitmap_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define Bitmap_First
#include "Types.h"
#include "Point.h"
#include "Ink.h"
class DevBitmap;
const int cPartPixelChanged= 12345;
//---- Bitmap ----------------------------------------------------------------
class Bitmap : public Ink {
protected:
DevBitmap *dbm, *mask;
void seedfill(int x, int y, u_int seed, u_int val);
public:
MetaDef(Bitmap);
Bitmap(Point sz, u_short depth= 1);
Bitmap(Point sz, u_short *data, u_short depth= 1);
Bitmap(int sz, u_short *data, u_short depth= 1);
Bitmap(DevBitmap *);
Bitmap(const char *name);
~Bitmap();
DevBitmap *GetDevBitmap()
{ return dbm; }
DevBitmap *GetDevMask()
{ return mask; }
void SetDevBitmap(DevBitmap*);
void SetDevMask(DevBitmap*);
void SetInk(Port *p);
void SetPixel(u_int x, u_int y, u_int value);
u_int GetPixel(u_int x, u_int y);
void Fill(u_int val);
void SeedFill(Point, u_int val);
void Clear()
{ Fill(0); }
int GetDepth();
Point Size();
int ShortsPerLine();
int BytesPerLine();
int Shorts()
{ return ShortsPerLine() * Size().y; }
int Bytes()
{ return Shorts() * 2; }
OStream& PrintOn(OStream&);
IStream& ReadFrom(IStream&);
Object *deepclone();
};
class SmartBitmap {
Point size;
u_short *bits;
Bitmap *bm;
const char *name;
public:
SmartBitmap(const Point &s, u_short *b)
{ size= s; bits= b; }
SmartBitmap(const char *nm)
{ name= nm; }
~SmartBitmap()
{ SafeDelete(bm); }
Bitmap *MakeBitmap();
operator Bitmap* ()
{ return bm ? bm : MakeBitmap(); }
};
#endif